
#include"ProgressBar.h"
typedef void(*func_t)(int);
void Download(func_t cb)
{
    int TaskSize=1000;//1000M
    int Downloaded=0;//已下载
    while(Downloaded<=TaskSize)
    {
        int rate=Downloaded*100/TaskSize;
        cb(rate);
        Downloaded+=10;
    }
    printf("\n");
}
int main()
{
    printf("Download1:\n");
    BarInit();
    Download(ProgressBar);

      printf("Download2:\n");
    BarInit();
    Download(ProgressBar);

  printf("Download3:\n");
    BarInit();
    Download(ProgressBar);
    return 0;
}